<%#
# To change this template, choose Tools | Templates
# and open the template in the editor.
%>



  <%# @ad =@categories.group%>
  <%# @ads = @ad.categories %>
  <%# @ads.each do |t|%>
  <%# viewname =t.name.gsub(" ","_") %>
   
    <%#*<div style="float:left;padding:5px;width:30%"><%= link_to(t.name,{:controller => "category_page" , :action =>"subcat_view" , :id=>t.id , :id2 =>params[:id2]})
 
  <%#end%>
  <div style="clear:both"></div>

  
  <h1><U><%= h @categories.name %></U> </h1>

  <% @add.each do |ad| %>
  <br />
  <div style="border:2px solid">
    <h2> <%=h ad.created_at.to_formatted_s(:long_ordinal) -%> </h2>
    <h1> <%=link_to h(ad.title), { :controller=> "advertisments" , :action=>"show" ,:id => ad} -%></h1>
    <h2> <%=h ad.location -%> </h2>
    <br>
    <%=h excerpt(ad.description , ' ', 300) -%>
    <p>
  </div>
  
  <%end%>

  <%=render :partial => "layouts/paginator", :locals => {:entities => @add} -%>

